Wikitext
Wikitext (wiki markup) is a markup language used to write web pages in wiki websites. __TOC__ Syntax The syntax discussed here is for MediaWiki-based wikis such as Wikipedia and Wikia. Line breaks Text separated by a single line break is rendered as if they were in the same line, separated by a space. However, an empty line will start a new paragraph. Some syntax in the succeeding line such as section headings will automatically end the current paragraph. Formatting ; Bold and italic text Bold text is enclosed with three apostrophes (). Italic text is enclosed with two apostrophes (''). These can be combined together, provided with proper nesting. Other instances of two or more instances of apostrophes must be escaped, for example by using the tag or by using an XML entity. Examples: Linking Internal links Internal hyperlinks (that is, a link to another page in the same wiki) are enclosed with double square brackets (...). A link to the same page is usually rendered as bold non-linked text. (This proves effective in navigational boxes.) Pages that do not exist in the wiki are replaced with a red link to create that page. Illegal text are not rendered. Example: Sections and anchors may be linked to using a number sign "#", as in HTML. For sections in the same page, the page name is omitted. Example: Piped links To specify text with the link, add a pipe then append the text. This is called a '''piped link. Some wikis support automatic conversion when a pipe is added at the end but no text is apecified, for example, Some link, such as omission of the namespace name and omission of text in parentheses. Plural forms and similar text tranformations may be achieved without using pipes by appending immediately after the closing bracket. When detected, they are rendered as "inside" the link. External links External hyperlinks can be specified explicitly. To specify text with the link, a space is appended after the link and the text follows, then the whole thing is enclosed in single square brackets. E-mail addresses may also be specified this way. Examples: Sections Section text is enclosed by equal signs ("="). The topmost heading has one equal sign ("=Heading 1="), the second-level heading has two (" Heading2 "), and so on. The page title is equivalent to the top-level heading, so using one equal sign is not recommended. Section headings must be in a new line. Images and media Images Images can be generated using internal link syntax, for example, " ". For images, an image caption can be added using piped link syntax, for example, . Additional parameters for the image syntax exist: left (floats to the left), right (floats to the right), none (goes inline with text), thumb (appears in the thumbnail with a caption), frame (appears in a frame), and (width is adjusted to in units specified by , aspect ratio preserved). x specifies an area boundary for the image: the image cannot be larger than that area, but it still maintains its aspect ratio. By default, large images are sized down, and such formats as SVG are converted, for example, to PNG. To link to the image or media itself, use the Media keyword, for example "Media:Flowers.jpg" directly links to the file "Flowers.jpg". To link to the description page, insert a colon at the beginning, for example, "Image:Flowers.jpg". Lists and indentation Unordered list items start with an asterisk (*) on each line. Ordered list items start with a number sign (#) and are automatically numbered, depending on the style. Indentation can be increased using a colon (:). These three may also be nested and repeated within each other. For example: Categories Pages can be categorized using link syntax to the Category page of the category, for example, "Category:Entertainment". This kind of text is not rendered in the page body, but all categories in a page is displayed in a separate section. To link to the category itself, insert a colon at the beginning, for example, "Category:Entertainment". Sort keys are specified by appending a pipe followed by the sort key after the category name. Sort keys are used to modify a page's sort order as it appears in a Category page. For example, it is a convention to sort English people by surname, so a sort key like "Smith, John" (for example, Smith, John). Interwiki links A link to another language version of the wiki or another wiki (a list of these wikis is stored in an interwiki table) may be specified using link syntax, as in the Categories section. Inter-language links themselves are not displayed, but all such links are displayed in a separate section. Tables Table content is enclosed in a bracket and vertical bar combination (" "), that must be in separate lines. Table rows start with a vertical bar and hyphen combination ("|-") and end with another of such or the end of the table. Table cells / data can be specified in separate lines starting with a pipe ("|") or in a single line starting with a pipe with two pipes ("||") separating each cell. Combinations of these may also be used. Table captions may be specified using a pipe and plus sign combination ("|+") at the start of the line. Table headings may be in either the start of the table (without starting a row) or in a row, using the exclamation mark ("!"). Preformatted text Preformatted text can be rendered by using leading spaces in each line. Equivalent HTML markup for this is the tag. Transclusion Templates may be transcluded into the current page by enclosing the template's name in double curly brackets (" "). Pages other than those in the Template namespace may also transcluded by including the namespace name. (Pages in the Main namespace are just preceded by a colon. For example, " ". In a template, parameters may be specified by a parameter name enclosed in triple curly brackets (" }"). Parameters are called by adding a pipe, followed by the parameter name, the equals sign, and the parameter value in the template call. When the parameter name is not specified, numbers are assumed, starting from 1. Examples: ; Parameters Default parameter values can be specified by adding a pipe followed by the default text to the parameter name. Just a pipe added indicates blank default value. If there is no default text, the parameter name together with the triple brackets will not be rendered. Examples: }}c || || ac |- | Template:T1 || a }c || || a }c |} Templates, parameters and default values may be nested (together with their wikitext). The pipe character is escaped by using an XML entity or by using a page, usually named Template:!, with the content "|". Transcluding this template has the effect of not making it a default parameter value separator. ; Encapsulation You may choose not to include text in transclusion by enclosing it with tags. On the other hand, you may choose text to be only included in transclusion and not displayed in the page text by enclosing it with tags. tags will only include the text within it, and also displays the text in the page. ; Substitution Templates may be substituted, that is, the template call will itself be replaced with its content, by inserting "subst:" before the template name. Rules of encapsulation of wikitext also apply. Signatures Users of a MediaWiki-based site can sign a signature specified in their preferences using four tildes ("~~~~"), which will usually substitute their username or IP address followed by a link to their talk page, followed by the date and time the page was saved. Three tildes will only substitute their username, while five tildes will substitute an extended signature format. Redirection Pages that redirect to another page, called a "redirect page", by using "#REDIRECT" followed by a simple internal link to the page. When the redirect page is rendered, it does not technically redirect to the target page, the target page itself is rendered, with a link back to the redirect page. Template calls to a redirect page will transclude the target page itself. Magic words Magic words are special strings of text that do certain effects on the page. One of these is the directive-like #REDIRECT. Another useful magic word is the tag, which instructs the parser not to parse its content and leave it as-is. (Even a simple single nowiki tag slightly breaks the parsing of content) ; Double underscores Magic words with double underscore specify more control over the rendering of the page than content. Some of these are (do not render table of contents), __TOC__ (render table of contents here) and __NOEDITSECTION__ (hide edit links beside section headings). ; Variables A number of variables exist, each of which look like a template call to a template in all caps. Some may even be substituted. Some of these are time variables that return the current date or time in either UTC or local time (CURRENTDAY, CURRENTTIME, LOCALTIMESTAMP, ...), page information (PAGENAME, FULLPAGENAME, REVISIONID, SITENAME, SERVER, ...), site statistics (NUMBEROFPAGES, CURRENTVERSION, ...), and others (PAGESIZE, ...). ; Template modifiers These exist to disambiguate between templates, magic word variables, and also provide access to the MediaWiki namespace. Some of these int: (access the page in the MediaWiki namespace, considering the language), msg: (override any magic words with the name and use the template), and subst: (substitute the template). ; Parser functions These are special calls that act as functions acting on its input. Most look like a template call to a template preceded with a number sign "#" (which is impossible to create). Aside from the standard set of parser functions, more may be defined using extensions. ; Miscellaneous magic words Extensions Extensions are add-ons added to a wiki that may add some additional functionality. Some standard parser-based extensions are "ParserFunctions", a set of programming language-like parser functions (which greatly aid in templates), "Cite", support of references using the tag (citation item) and tag (citation list of all items in the page), "Poem", automatically adds line breaks, overriding the default parsing of text in it, "CharInsert", adds a tag that inserts text into a text box when clicked, "ImageMap", rendering of HTML image maps using the tag, and "EasyTimeline", renders a timeline image using the tag. Math Math symbols and formulae may be rendered using the tag. Formulae must be in a TeX format. Horizontal rule A horizontal rule can be rendered using four hyphens ("----"), but usage of such is not recommended. Comments Comments are enclosed in tags, as in XML. These are ignored by the parser itself and is ignored, thus it does not show up in the page's source. Usage of HTML A subset of HTML is sometimes supported in some wikis. For instance, this is the standard set of HTML that can be used in a MediaWiki website: References * Help:Editing - Meta-Wiki (Wikimedia) Category:Markup languages